home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 031a / wbt31b.zip / INIEDIT.WB$ < prev    next >
Text File  |  1991-12-29  |  2KB  |  87 lines

  1. CR=strcat(Num2char(13),Num2char(10))
  2. TAB=Num2Char(9)
  3. DirChange(DirWindows(0))
  4. canned="BYEBYE"
  5. IniFiles=""
  6.  
  7. :UP1
  8. canned="byebye"
  9. If IniFiles!="" then goto inied
  10. IniFiles=FileItemize("*.INI")
  11. :inied
  12. TheFile=ItemSelect("Choose Desired INI file",IniFiles," ")
  13. if TheFile=="" then goto newini
  14. Sections=""
  15.  
  16. :UP2
  17. canned="up1"
  18. if Sections!="" then goto sected
  19. Sections=IniItemizePvt("",TheFile)
  20. :SECTED
  21. Section=ItemSelect("%TheFile% - Choose Section",Sections,TAB)
  22. if Section=="" then goto AddSect
  23. KeyValues=""
  24.  
  25. :UP3
  26. canned="up2"
  27. if KeyValues!="" then goto looped
  28. Keys=IniItemizePvt(Section,TheFile)
  29. KeyMax=ItemCount(Keys,TAB)
  30. KeyIndex=0
  31.  
  32. :Loop
  33. if KeyIndex==KeyMax then goto looped
  34. KeyIndex=KeyIndex+1
  35. ThisKey=ItemExtract(KeyIndex,Keys,TAB)
  36. ThisValue=IniReadPvt(Section,ThisKey,"???",TheFile)
  37. KeyValues=strcat(KeyValues,ThisKey,"= ",ThisValue,TAB)
  38. goto Loop
  39.  
  40. :looped
  41. Key=ItemSelect("%TheFile% [%Section%] - Choose Keyword",KeyValues,TAB)
  42. if Key=="" then goto AddKey
  43. Key=ItemExtract(1,Key,"=")
  44.  
  45. Value=IniReadPvt(Section,Key,"???",TheFile)
  46. goto entkey
  47.  
  48.  
  49. :newini
  50. canned="UP1"
  51. TheFile=Askline("Making NEW INI file","Enter new INI file name","*.INI")
  52. if (TheFile=="*.INI" || TheFile=="") then goto newini
  53. IniFIles=""
  54. goto AddSectNewIni
  55.  
  56. :AddSect
  57. canned="up2"
  58. :AddSectNewIni
  59. Section=AskLine("Add New Section to INI File","Enter new section name for%CR%   %TheFile%%CR%      [?????]","")
  60. Sections=""
  61. goto AddKeyNewSect
  62.  
  63. :AddKey
  64. canned="up3"
  65. :AddKeyNewSect
  66. Key=AskLine("Add New Keyword to INI File","Enter new key name for%CR%   %TheFile%%CR%      [%Section%]","")
  67. Value="(Undefined)"
  68. KeyValues=""
  69. goto EntKeyNewKey
  70.  
  71. :ENTKEY
  72. canned="up3"
  73. :EntKeyNewkey
  74. NewValue=AskLine("Modify INI File Keyword","%TheFile%%CR%   [%Section%]%CR%      %Key% = %Value%",Value)
  75. if NewValue!=Value then iniwritepvt(Section,Key,NewValue,TheFile)
  76. KeyValues=""
  77. goto up3
  78.  
  79.  
  80. :CANCEL
  81. goto %Canned%
  82.  
  83. :BYEBYE
  84. exit
  85.  
  86.  
  87.